package com.atguigu.paymentdemo.vo;

import lombok.Data;

import java.util.HashMap;
import java.util.Map;

@Data
public class Result {
    private Integer code;//响应码
    private String msg;//响应信息
    private Map<String, Object> data = new HashMap<>();//响应数据

    public static Result ok(){
        Result result = new Result();
        result.setCode(0);
        result.setMsg("success");
        return result;
    }
    public static Result error(){
        Result result = new Result();
        result.setCode(-1);
        result.setMsg("error");
        return result;
    }

    public Result data(String key, Object value){
        this.data.put(key, value);
        return this;
    }






}
